<style>
.ben-left{float:left}

.ben-right{float:right}

.clearer{clear:both;font-size:0;height:0;}

.head-content {font-size:0.8em;padding:3px;}

.head-content b{font-size:1.1em}

.section{padding:3px;border:1px solid #ccc;}

.table-content{border:1px solid #bbb;border-collapse:collapse;}

.table-content th {background-color:#ddd;}

.table-content td, .table-content th{border:1px solid #bbb;padding:3px}

.section-title h3{margin:5px 0px;padding:4px 2px;background:#eee;font-size:1.8em;text-align:center}

.info-content{padding:5px 0px;}

.info-content label{font-weight:bold;}

.info-content p{margin:3px;border-bottom:1px dotted #222}

</style>
<?php include(DIR_TEMPLATE."common/definefone.tpl");?>
<div class="section" id="sitemaplist">
	
    <div class="head-content">
    	
        <div class="ben-left">
<b>TAI SRENG CONSTRUCTION MATERIAL SUPPLIER</b><br />
<?php echo $this->document->text['text_address']?>: 125/12 Alexanderose, Phnomphend, Campodia<br />
Tel: 011 75 19 19 - 016 6 7777 2 - 0236 683 168<br />
Email: info@tesreng.com - Website: www.tesreng.com
		</div>
        <div class="ben-right"><img src="<?php echo DIR_IMAGE?>logo.gif" /></div>
        <div class="clearer">&nbsp;</div>
    </div>

	<div class="section-title"><h3>Sale Order</h3></div>
    
    <div class="section-content padding1">
    
    	<form name="frm" action="<?php echo $action?>" method="post" enctype="multipart/form-data">
            <div class="clearer">&nbsp;</div>
        	<div class="info-content">
            	<p>
            		<label>ID:&nbsp;&nbsp;</label>
					<?php echo $order['orderid']?>
            	</p>
            	<p>
            		<label>Create by:&nbsp;&nbsp;</label>
					<?php echo $order['createby']?>
            	</p>

                <p>
            		<label>Customer:&nbsp;&nbsp;</label>
					<?php echo html_entity_decode($order['customername'])?>
            	</p>

<?php
	if($order['address'] !="")
    {
?>
                <p>
            		<label><?php echo $this->document->text['text_address']?>:&nbsp;&nbsp;</label>
					<?php echo html_entity_decode($order['address'])?>
            	</p>
<?php
	}
?>
<?php
	if($order['email'] !="")
    {
?>
                <p>
            		<label><?php echo $this->document->text['text_email']?>:&nbsp;&nbsp;</label>
					<?php echo $order['email']?>
            	</p>
<?php
	}
?>
<?php
	if($order['phone'] !="")
    {
?>                <p>
            		<label><?php echo $this->document->text['text_phone']?>:&nbsp;&nbsp;</label>
					<?php echo $order['phone']?>
            	</p>
<?php
	}
?>
                <p>
            		<label><?php echo $this->document->text['text_date']?>:&nbsp;&nbsp;</label>
					<?php echo $this->date->formatMySQLDate($order['orderdate'])?>
            	</p>
<?php
	if($order['comment'] !="")
    {
?>
                <p>
            		<label><?php echo $this->document->text['text_note']?>:&nbsp;&nbsp;</label>
					<?php echo $order['comment']?>
            	</p>
<?php
	}
?>
<!--<?php
	if($order['insuranceid'] !="")
    {
?>
				<p>
            		<label>Insurance ID:&nbsp;&nbsp;</label>
                    <?php echo $order['insuranceid']?>
            	</p>
                <p>
            		<label>Insurance %:&nbsp;&nbsp;</label>
                    <?php echo $order['insurancepercent']?>%
            	</p>
<?php
	}
?>
-->            </div>
            <div>
            	<!--<table width="100%" class="table-content"> 
                	<thead>
                    	<tr>
                            <th align="left">Service</th>
                            <th align="right">Quantity</th>
                            <th align="left"><?php echo $this->document->text['text_unit']?></th>
                            <th align="right"><?php echo $this->document->text['text_price']?></th>
                            <th align="right"><?php echo $this->document->text['text_discount']?></th>
                            <th align="right">Sub total</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php 
                  	$sevice = $this->string->array_Filter($detail,"type","saleservice");
                    foreach($sevice as $item)
                    { 
                    
                    ?>
                    	<tr>
                            <td><?php echo $item['title']?></td>
                            <td align="right"><?php echo $this->string->numberFormate($item['quantity'])?></td>
                            <td align="left"><?php echo $item['unit']?></td>
                            <td align="right"><?php echo $this->string->numberFormate($item['price'])?></td>
                            <td align="right"><?php echo $this->string->numberFormate($item['discount'])?>%</td>
                            <td align="right"><?php echo $this->string->numberFormate($item['subtotal'])?></td>
                        </tr>
                    <?php 
                    	
                    } 
                    ?>
                    </tbody>
                    
                </table>-->
            	<table width="100%" class="table-content"> 
                	<thead>
                    	<tr>
                            <th align="left">Product name</th>
                            <th align="right">Quantity</th>
                            <th align="left"><?php echo $this->document->text['text_unit']?></th>
                            <th align="right"><?php echo $this->document->text['text_price']?></th>
                            <th align="right"><?php echo $this->document->text['text_discount']?></th>
                            <th align="right">Sub total</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php 
                  	$product = $this->string->array_Filter($detail,"type","sale");
                    foreach($product as $item)
                    { 
                    
                    ?>
                    	<tr>
                            <td><?php echo $item['title']?></td>
                            <td align="right"><?php echo $this->string->numberFormate($item['quantity'])?></td>
                            <td align="left"><?php echo $item['unit']?></td>
                            <td align="right"><?php echo $this->string->numberFormate($item['price'])?></td>
                            <td align="right"><?php echo $this->string->numberFormate($item['discount'])?>%</td>
                            <td align="right"><?php echo $this->string->numberFormate($item['subtotal'])?></td>
                        </tr>
                    <?php 
                    	
                    } 
                    ?>
                    </tbody>
                    <tfoot>
                    	<tr>
                            <th></th>
                            <th></th>
                            <th align="right"></th>
                            <th align="right"></th>
                            <th align="right"><strong>Total</strong></th>
                            <th align="right"><strong><?php echo $this->string->numberFormate($sum)?></strong></th>
                        </tr>
                        <!--<tr>
                            <th></th>
                            <th></th>
                            <th align="right"></th>
                            <th align="right"></th>
                            <th align="right"><strong>Insurance</strong></th>
                            <th align="right"><strong><?php echo $this->string->numberFormate($order['insurancepercent'])?>%</strong></th>
                        </tr>
                        <tr>
                            <th></th>
                            <th></th>
                            <th align="right"></th>
                            <th align="right"></th>
                            <th align="right"><strong>Final total</strong></th>
                            <th align="right"><strong><?php echo $this->string->numberFormate( $sum* (1- $order['insurancepercent'] / 100) )?></strong></th>
                        </tr>-->
                    </tfoot>
                </table>
            </div>
        </form>
    
    </div>
    
</div>
<script language="javascript">
	window.print();
</script>
